﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CRUD;

namespace Client
{
    class Presenter : IPresenter
    {
        public IModel im = null;
        public IView iv = null;
        public string path="";
        public void create(int id, string lname, string fname, int age)
        {
            Person p = new Person();
            p.Age = age;
            p.FName = fname;
            p.LName = lname;
            p.id = id;
            im.create(path, p);
        }
        public void read()
        {
           MyList tmp =  im.read(path);
           iv.show(tmp);
        }
        public void update(int id, string lname, string fname, int age)
        {
            Person p = new Person();
            p.Age = age;
            p.FName = fname;
            p.LName = lname;
            p.id = id;
            im.update(path, p);
        }
        public void delete(int id) 
        {
            im.delete(path, id);
        }
    }
}
